package org.ddd.book.infrastructure.eventpublisher;

import lombok.extern.slf4j.Slf4j;
import org.ddd.book.domain.IBaseEvent;
import org.ddd.book.domain.IEventPublisher;
import org.springframework.stereotype.Component;

/**
 * 消息队列事件发布器
 */
@Component
@Slf4j
public class MQEventPublisher implements IEventPublisher {

    @Override
    public void publishEvent(IBaseEvent event) {
        String topic = event.eventType().getName();
        String tag = event.subEventType().getName();
        log.info("The MQS topicTag = {}:{}", topic, tag);
    }

}
